package com.kwan.xframe.mvvm;

import com.kwan.xframe.util.RxLifeUtils;

import io.reactivex.rxjava3.core.Flowable;

public abstract class BaseManager {

	public abstract BaseTokenManager getBaseTokenManager();

	public <T> Flowable<T> execute(Flowable<T> command) {
		//线程调度
		return command.compose(RxLifeUtils.schedulersTransformer());
	}

	public <T> Flowable<T> executeWithToken(Flowable<T> command) {
		//线程调度
		Flowable<T> flowable = command.compose(RxLifeUtils.schedulersTransformer());
		return getBaseTokenManager().handleToken(flowable);
	}

}
